package main

import "fmt"

func isIsomorphic(s string, t string) bool {
	mapS2T, mapT2S := map[byte]byte{}, map[byte]byte{}
	for i := range s {
		sB, tB := s[i], t[i]
		if mapS2T[sB] > 0 && mapS2T[sB] != tB || mapT2S[tB] > 0 && mapT2S[tB] != sB {
			return false
		}
		mapS2T[sB], mapT2S[tB] = tB, sB
	}
	return true
}
func main() {
	fmt.Println(isIsomorphic("egg", "add"))
}
